package edu.sctu.practice.class02.shilaihong.assign03.text2;

import java.lang.*;
import java.lang.Comparable;

/**
 * Created by admin on 2015/10/29.
 */
public class ComparableCircle extends Circle implements Comparable {
    public ComparableCircle(double r){
        this.r=r;
    }

    @Override
    public int compareTo(Object o) {
        if (getArea()>((ComparableCircle)o).getArea()) {
            return 0;
        }
        else {
            return 1;
        }
    }
    private double getArea(){
        return r*r*Math.PI;
    }
}
